#ifndef __COLLISION_H__
#define __COLLISION_H__

#include "shape.h"

#include "vec.h"
#include <utility>
using std::pair;

//* ----- Type Definition -----
typedef vec3 Point3D;

class Collision {
protected:
	//! Collision between Bounding Volumes
	/*! Tests if two Bounding Volumes are intersecting
	 */
	bool collision(pair<Point3D, Point3D> bv1, pair<Point3D, Point3D> bv2);

public:
	//! Constructor
	/*! Just creates the object
	 */
	Collision();
	
	//! Collision between Shapes (it will be removed when the perfect collision is made)
	/*! Tests if two Shapes are intersecting
	 */
	bool collision(Shape * s1, Shape * s2);

	//! Collision between a Parallelepiped and sphere
	/*! Tests if the two Shapes are intersecting
	 */
	bool collision(Parallelepiped p1, Sphere s1);

	//! Collision between a Parallelepiped and tetrahedron
	/*! Tests if the two Shapes are intersecting
	 */
	bool collision(Parallelepiped p1, Tetrahedron t1);

	//! Collision between a Parallelepiped and a Pyramid
	/*! Tests if the two Shapes are intersecting
	 */
	bool collision(Parallelepiped p1, Pyramid pi1);

	//! Collision between two Parallelepiped
	/*! Tests if the two Shapes are intersecting
	 */
	bool collision(Parallelepiped p1, Parallelepiped p2);

	//! Collision between a Tetrahedron and a Sphere
	/*! Tests if the two Shapes are intersecting
	 */
	bool collision(Tetrahedron t1, Sphere s1);

	//! Collision between two Tetrahedron
	/*! Tests if the two Shapes are intersecting
	 */
	bool collision(Tetrahedron t1, Tetrahedron t2);

	//! Collision between a Tetrahedron and a Pyramid
	/*! Tests if the two Shapes are intersecting
	 */
	bool collision(Tetrahedron t1, Pyramid p1);

	//! Collision between two Spheres
	/*! Tests if the two Shapes are intersecting
	 */
	bool collision(Sphere s1, Sphere s2);

	//! Collision between a Sphere and a Pyramid
	/*! Tests if the two Shapes are intersecting
	 */
	bool collision(Sphere s1, Pyramid p1);

	//! Collision between two Pyramids
	/*! Tests if the two Shapes are intersecting
	 */
	bool collision(Pyramid p1, Pyramid p2);
};

#endif
